
<template>
    <div>
        <ul>
            <li v-for="(item,index) in list" :key="index" @click="handleClick(item)">
                {{item.name}}
            </li>
        </ul>
    </div>


</template>
<script setup>
import { ref ,onMounted} from 'vue';
const list=ref([])
onMounted(async()=>{
   const res=await fetch('https://mock.mengxuegu.com/mock/66585c4db462b81cb3916d3e/songer/songer')
   const data= await res.json()
   console.log(data);
   list.value=data.data
})
const handleClick=(item)=>{
    console.log(item);
    list.value=list.value.filter((cur)=>cur.name!==item.name)
}

</script>


<style lang="css" scoped>

</style>